﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class SpecialAction
    {
        // 得到栏目名到其ID的映射
        public static DataTable ColumnNameToID()
        {
            string sql = "select ID,Name from tb_column";
            Utility.SQLHelper db = new Utility.SQLHelper();
            DataTable dt = db.ExecuteQuery(sql, CommandType.Text);
            return dt;
        }

        // 得到角色名到其ID的映射
        public static DataTable RoleNameToID()
        {
            string sql = "select ID,Name from tb_role";
            Utility.SQLHelper db = new Utility.SQLHelper();
            DataTable dt = db.ExecuteQuery(sql, CommandType.Text);
            return dt;
        }

        // 得到用户名到其ID的映射
        public static DataTable UserNameToID()
        {
            string sql = "select ID,Name from tb_user";
            Utility.SQLHelper db = new Utility.SQLHelper();
            DataTable dt = db.ExecuteQuery(sql, CommandType.Text);
            return dt;
        }
    }
}
